package com.chen.project.white_jotter.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(indexName = "articles", shards = 5, replicas = 0, createIndex = true)
public class JotterArticle implements Serializable {

    @TableId(type = IdType.AUTO)
    @Id
    private Integer id;

    @Field(type = FieldType.Text)
    private String articleTitle;

    @Field(type = FieldType.Keyword)
    private String articleAuthor;

    @Field(type = FieldType.Text)
    private String articleContentMd;

    @Field(type = FieldType.Text, analyzer = "ik_smart")
    private String articleAbstract;

    @Field(type = FieldType.Keyword)
    private String articleCover = "https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg";

    @Field(type = FieldType.Long)
    private Long articleDate;

    private static final long serialVersionUID = 1L;
}
